<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function check(){
				let username=document.getElementById("username").value
				if(username==""){
				document.getElementById("span1").innerHTML="姓名不能为空"
				return false
				}else{
				document.getElementById("span1").innerHTML="姓名验证通过"
				}
				let password=document.getElementById("password").value
				if(password.length<6){
				document.getElementById("span2").innerHTML="密码长度不足六位"
				return false
				}else{
				document.getElementById("span2").innerHTML="姓名验证通过"
				}
				let age=document.getElementById("age").value
				if(isNaN(age)||age>0||age<150){
				document.getElementById("span2").innerHTML="密码长度不足六位"
				return false
				}else{
				document.getElementById("span2").innerHTML="姓名验证通过"
				}
				let age=document.getElementById("age").value
				if(isNaN(age)||age>0||age<150){
				document.getElementById("span2").innerHTML="密码长度不足六位"
				return false
				}else{
				document.getElementById("span2").innerHTML="姓名验证通过"
				}
			}
		</script>
	</head>
	<body>
		<form action="success.html" onsubmit="return check()">
			姓名：<input type="text" id="username"><span id="span1"></span><br>
			密码：<input type="text" id="password"><span id="span2"></span><br>
			年龄：<input type="text" id="age"><span id="span3"></span><br>
			手机：<input type="text" id="mobilephone"><span id="span4"></span><br>
			<input type="submit" value="提交">
		</form>
	</body>
</html>
